package test;

import java.math.BigDecimal;

public class FeeMain {

    public static void main(String[] args) {
        BigDecimal fee=BigDecimal.ZERO;
        BigDecimal principle=new BigDecimal(500);
        int profitDays=35;
        String  rate="0.4";
        int daysYear=360;
        fee = principle.multiply(new BigDecimal(profitDays)).multiply(new BigDecimal(rate))
                .divide(new BigDecimal(100).multiply(new BigDecimal(daysYear)),2,  BigDecimal.ROUND_HALF_UP);
        System.out.println(fee);
    }
}
